/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import java.util.List;

import controll.Mapping;

/**
 *
 * @author phuc
 */
public class NhanVien implements Serializable {
    private static final long serialVersionUID = 1L;
    private Long nhanVienID;
    private String ten;
    private String diaChi;
    private String sdt;
    private String email;
    private String userName;
    private String passWord;
    private List<HoaDon> hoaDonList;
    private Mapping map  = null;
    
    public NhanVien() {
    }

    public NhanVien(Long nhanVienID) {
        this.nhanVienID = nhanVienID;
    }

    public NhanVien(Long nhanVienID, String ten, String userName, String passWord) {
        this.nhanVienID = nhanVienID;
        this.ten = ten;
        this.userName = userName;
        this.passWord = passWord;
    }

    public Long getNhanVienID() {
        return nhanVienID;
    }

    public void setNhanVienID(Long nhanVienID) {
        this.nhanVienID = nhanVienID;
    }

    public String getTen() {
        return ten;
    }

    public void setTen(String ten) {
        this.ten = ten;
    }

    public String getDiaChi() {
        return diaChi;
    }

    public void setDiaChi(String diaChi) {
        this.diaChi = diaChi;
    }

    public String getSdt() {
        return sdt;
    }

    public void setSdt(String sdt) {
        this.sdt = sdt;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public List<HoaDon> getHoaDonList() {
    	map = new Mapping();
    	return map.getHoaDonList(this);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nhanVienID != null ? nhanVienID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NhanVien)) {
            return false;
        }
        NhanVien other = (NhanVien) object;
        if ((this.nhanVienID == null && other.nhanVienID != null) || (this.nhanVienID != null && !this.nhanVienID.equals(other.nhanVienID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.NhanVien[ nhanVienID=" + nhanVienID + " ]";
    }

	public NhanVien getNhanVienByID(long nhanVienID) {
		return map.getNhanVienByID(nhanVienID);
	}
    
}
